package com.booking.springrestful.controller;

import com.booking.springrestful.domain.vo.AnalyticsMapVo;
import com.booking.springrestful.domain.vo.BookingTimesVo;
import com.booking.springrestful.domain.vo.RatingVo;
import com.booking.springrestful.resp.ResponseResult;
import com.booking.springrestful.service.AppointmentsService;
import com.booking.springrestful.service.UseranalyticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
@RequestMapping("/analytics")
public class analyticsController {

    @Resource
    private UseranalyticsService useranalyticsService;


    @Resource
    private AppointmentsService appointmentsService;


    //用户全国分布接口
    @GetMapping("/map")
    private ResponseResult<List<AnalyticsMapVo>> map(){
        List<AnalyticsMapVo> list=useranalyticsService.map();
        return ResponseResult.success(list);
    }


    //预约次数分析接口
    @GetMapping("/bookingTimes")
    private ResponseResult<List<BookingTimesVo>> bookingTimes(){
        List<BookingTimesVo> list= appointmentsService.bookingTimes();
        return ResponseResult.success(list);
    }

    //统计咨询师预约和评分
    @GetMapping("/rating")
    private ResponseResult<List<RatingVo>> rating(){
        List<RatingVo> list=appointmentsService.rating();
        return ResponseResult.success(list);
    }
}
